package com.lanou.dllo.baisibudejie.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import com.lanou.dllo.baisibudejie.R;

/**
 * Created by dllo on 15/10/30.
 */
public class SendJokeActivity extends Activity implements View.OnClickListener {

    private TextView cancelTv, sendTv;
    private EditText contentEt;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //设置布局
        setContentView(R.layout.activity_sendjoke);
        //初始化控件
        initView();
    }

    //初始化控件
    private void initView() {

        cancelTv = (TextView) findViewById(R.id.cancelTv);//返回
        cancelTv.setOnClickListener(this);
        sendTv = (TextView) findViewById(R.id.sendTv);//发送
        sendTv.setOnClickListener(this);
        contentEt = (EditText) findViewById(R.id.contentEt);//内容

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.cancelTv://返回
                finish();
                break;
            case R.id.sendTv://发送
                String content = contentEt.getText().toString();

                Intent intent_send = new Intent(this, MyCardActivity.class);
                intent_send.putExtra("content", content);
                startActivity(intent_send);
                finish();
                break;
        }
    }
}
